<template>
  <div class="page">
    <div class="main">
      <el-card class="box-card" style="height:800px">
        <div slot="header" class="clearfix">
          <span>
            <navigation />
          </span>
          <el-button @click="dataGrade()" type="primary" size="small">打分</el-button>
        </div>
        <b
          style="margin-left:10px;font-size:14px;position: relative;top: -10px;"
        >{{ $route.query.name }}</b>
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick" :before-leave="Tabever">
          <el-tab-pane label="市级" name="first">
            <el-table
              border
              :data="tableData"
              style="width: 100%"
              height="600px"
              size="small"
              :header-cell-style="{ background: '#f5f5f5' }"
            >
              <el-table-column align="center" type="index" label="序号"></el-table-column>
              <el-table-column align="center" width="80" prop="departmentTypeName" label="单位类别"></el-table-column>
              <el-table-column align="center" width="200" prop="departmentName" label="单位名称"></el-table-column>

              <el-table-column align="center" label="一季度">
                <el-table-column align="center" width="60" prop="score1" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank1" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank1 }}</b>
                      <img :src="scope.row.imgUrl1" v-if="scope.row.imgUrl1 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription1" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription1"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription1 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 1)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status1" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status1 == 1
                    ? "待审核"
                    : scope.row.status1 == 2
                    ? "审核通过"
                    : scope.row.status1 == -1
                    ? "驳回"
                    : scope.row.score1 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="二季度">
                <el-table-column align="center" width="60" prop="score2" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank2" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank2 }}</b>
                      <img :src="scope.row.imgUrl2" v-if="scope.row.imgUrl2 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription2" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription2"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription2 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 2)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status2" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status2 == 1
                    ? "待审核"
                    : scope.row.status2 == 2
                    ? "审核通过"
                    : scope.row.status2 == -1
                    ? "驳回"
                    : scope.row.score2 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="三季度">
                <el-table-column align="center" width="60" prop="score3" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank3" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank3 }}</b>
                      <img :src="scope.row.imgUrl3" v-if="scope.row.imgUrl3 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription3" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription3"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription3 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 3)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status3" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status3 == 1
                    ? "待审核"
                    : scope.row.status3 == 2
                    ? "审核通过"
                    : scope.row.status3 == -1
                    ? "驳回"
                    : scope.row.score3 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="第四季度">
                <el-table-column align="center" width="60" prop="score4" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank4" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank4 }}</b>
                      <img :src="scope.row.imgUrl4" v-if="scope.row.imgUrl4 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription4" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription4"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription4 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 4)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status4" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status4 == 1
                    ? "待审核"
                    : scope.row.status4 == 2
                    ? "审核通过"
                    : scope.row.status4 == -1
                    ? "驳回"
                    : scope.row.score4 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="区县" name="second">
            <el-table
              border
              :data="tableData"
              style="width: 100%"
              height="600px"
              size="small"
              :header-cell-style="{ background: '#f5f5f5' }"
            >
              <el-table-column align="center" type="index" label="序号"></el-table-column>
              <el-table-column align="center" width="80" prop="departmentTypeName" label="单位类别"></el-table-column>
              <el-table-column align="center" width="200" prop="departmentName" label="单位名称"></el-table-column>

              <el-table-column align="center" label="一季度">
                <el-table-column align="center" width="60" prop="score1" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank1" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank1 }}</b>
                      <img :src="scope.row.imgUrl1" v-if="scope.row.imgUrl1 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription1" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription1"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription1"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 1)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status1" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status1 == 1
                    ? "待审核"
                    : scope.row.status1 == 2
                    ? "审核通过"
                    : scope.row.status1 == -1
                    ? "驳回"
                    : scope.row.score1 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="二季度">
                <el-table-column align="center" width="60" prop="score2" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank2" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank2 }}</b>
                      <img :src="scope.row.imgUrl2" v-if="scope.row.imgUrl2 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription2"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription2"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 2)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status2" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status2 == 1
                    ? "待审核"
                    : scope.row.status2 == 2
                    ? "审核通过"
                    : scope.row.status2 == -1
                    ? "驳回"
                    : scope.row.score2 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="三季度">
                <el-table-column align="center" width="60" prop="score3" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank3" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank3 }}</b>
                      <img :src="scope.row.imgUrl3" v-if="scope.row.imgUrl3 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription3" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription3"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription3"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 3)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status3" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status3 == 1
                    ? "待审核"
                    : scope.row.status3 == 2
                    ? "审核通过"
                    : scope.row.status3 == -1
                    ? "驳回"
                    : scope.row.score3 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="第四季度">
                <el-table-column align="center" width="60" prop="score4" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank4" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank4 }}</b>
                      <img :src="scope.row.imgUrl4" v-if="scope.row.imgUrl4 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription4" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription4"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription4"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 4)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status4" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status4 == 1
                    ? "待审核"
                    : scope.row.status4 == 2
                    ? "审核通过"
                    : scope.row.status4 == -1
                    ? "驳回"
                    : scope.row.score4 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="西咸新区" name="fourth">
            <el-table
              border
              :data="tableData"
              style="width: 100%"
              height="600px"
              size="small"
              :header-cell-style="{ background: '#f5f5f5' }"
            >
              <el-table-column align="center" type="index" label="序号"></el-table-column>
              <el-table-column align="center" width="80" prop="departmentTypeName" label="单位类别"></el-table-column>
              <el-table-column align="center" width="200" prop="departmentName" label="单位名称"></el-table-column>

              <el-table-column align="center" label="一季度">
                <el-table-column align="center" width="60" prop="score1" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank1" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank1 }}</b>
                      <img :src="scope.row.imgUrl1" v-if="scope.row.imgUrl1 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription1" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription1"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription1"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 1)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status1" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status1 == 1
                    ? "待审核"
                    : scope.row.status1 == 2
                    ? "审核通过"
                    : scope.row.status1 == -1
                    ? "驳回"
                    : scope.row.score1 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="二季度">
                <el-table-column align="center" width="60" prop="score2" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank2" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank2 }}</b>
                      <img :src="scope.row.imgUrl2" v-if="scope.row.imgUrl2 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription2" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription2"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription2"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 2)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status2" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status2 == 1
                    ? "待审核"
                    : scope.row.status2 == 2
                    ? "审核通过"
                    : scope.row.status2 == -1
                    ? "驳回"
                    : scope.row.score2 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="三季度">
                <el-table-column align="center" width="60" prop="score3" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank3" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank3 }}</b>
                      <img :src="scope.row.imgUrl3" v-if="scope.row.imgUrl3 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription3" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription3"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription3 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 3)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status3" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status3 == 1
                    ? "待审核"
                    : scope.row.status3 == 2
                    ? "审核通过"
                    : scope.row.status3 == -1
                    ? "驳回"
                    : scope.row.score3 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="第四季度">
                <el-table-column align="center" width="60" prop="score4" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank4" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank4 }}</b>
                      <img :src="scope.row.imgUrl4" v-if="scope.row.imgUrl4 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription4" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription4"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription4 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 4)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status4" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status4 == 1
                    ? "待审核"
                    : scope.row.status4 == 2
                    ? "审核通过"
                    : scope.row.status4 == -1
                    ? "驳回"
                    : scope.row.score4 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="开发区" name="third">
            <el-table
              border
              :data="tableData"
              style="width: 100%"
              height="600px"
              size="small"
              :header-cell-style="{ background: '#f5f5f5' }"
            >
              <el-table-column align="center" type="index" label="序号"></el-table-column>
              <el-table-column align="center" width="80" prop="departmentTypeName" label="单位类别"></el-table-column>
              <el-table-column align="center" width="200" prop="departmentName" label="单位名称"></el-table-column>

              <el-table-column align="center" label="一季度">
                <el-table-column align="center" width="60" prop="score1" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank1" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank1 }}</b>
                      <img :src="scope.row.imgUrl1" v-if="scope.row.imgUrl1 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription1" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription1"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription1 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 1)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status1" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status1 == 1
                    ? "待审核"
                    : scope.row.status1 == 2
                    ? "审核通过"
                    : scope.row.status1 == -1
                    ? "驳回"
                    : scope.row.score1 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="二季度">
                <el-table-column align="center" width="60" prop="score2" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank2" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank2 }}</b>
                      <img :src="scope.row.imgUrl2" v-if="scope.row.imgUrl2 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription2" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription2"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription2 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 2)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status2" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status2 == 1
                    ? "待审核"
                    : scope.row.status2 == 2
                    ? "审核通过"
                    : scope.row.status2 == -1
                    ? "驳回"
                    : scope.row.score2 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="三季度">
                <el-table-column align="center" width="60" prop="score3" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank3" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank3 }}</b>
                      <img :src="scope.row.imgUrl3" v-if="scope.row.imgUrl3 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription3" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription3"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription3 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 3)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status3" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status3 == 1
                    ? "待审核"
                    : scope.row.status3 == 2
                    ? "审核通过"
                    : scope.row.status3 == -1
                    ? "驳回"
                    : scope.row.score3 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="第四季度">
                <el-table-column align="center" width="60" prop="score4" label="分数"></el-table-column>
                <el-table-column align="center" width="80" prop="rank4" label="排名">
                  <template slot-scope="scope">
                    <span class="lightSty">
                      <b>{{ scope.row.rank4 }}</b>
                      <img :src="scope.row.imgUrl4" v-if="scope.row.imgUrl4 != null" />
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="rankDescription4" label="描述">
                  <template slot-scope="scope">
                    <el-popover
                      placement="top-start"
                      title="描述"
                      width="200"
                      trigger="click"
                      :content="scope.row.rankDescription4"
                    >
                      <el-button
                        slot="reference"
                        v-show="scope.row.rankDescription4 != null"
                        class="describe"
                      >描述</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="100" label="附件">
                  <template slot-scope="scope">
                    <el-button type="warning" size="mini" @click="handFileList(scope.row, 4)">附件</el-button>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status4" label="状态">
                  <template slot-scope="scope">
                    {{
                    scope.row.status4 == 1
                    ? "待审核"
                    : scope.row.status4 == 2
                    ? "审核通过"
                    : scope.row.status4 == -1
                    ? "驳回"
                    : scope.row.score4 != null
                    ?"未审核":''
                    }}
                  </template>
                </el-table-column>
              </el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </div>
    <el-dialog title="打分" :visible.sync="dialog" width="70%" center :before-close="handleClose">
      <div>
        <div>
          <b>{{ currName }} 季度打分</b>
          <b>选择季度:</b>
          <el-select v-model="currQuarter" @change="currChange()">
            <el-option
              v-for="(item, index) in quarterList"
              :key="index"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
          <b style="margin-left:20px;">部门:</b>
          <el-select v-model="departmentsId">
            <el-option
              v-for="(item, index) in bumenDepartments"
              :key="index"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>

          <el-button type="primary" @click="addDatum()">添加</el-button>
        </div>
        <div style="padding-top:10px">
          <el-table
            border
            :data="temporaryData"
            style="width: 100%"
            height="430px"
            size="small"
            :header-cell-style="{ background: '#f5f5f5' }"
          >
            <el-table-column align="center" width="80" label="序号" prop="index"></el-table-column>
            <el-table-column align="center" width="80" label="操作">
              <template slot-scope="scope">
                <el-button
                  v-if="ButtonStatus"
                  type="danger"
                  icon="el-icon-delete"
                  size="small"
                  @click="deleteDatalisy(scope.row)"
                ></el-button>
                <el-button
                  v-else
                  disabled
                  type="danger"
                  icon="el-icon-delete"
                  size="small"
                  @click="deleteDatalisy(scope.row)"
                ></el-button>
              </template>
            </el-table-column>
            <el-table-column align="center" width="80" prop="departmentTypeName" label="单位类别"></el-table-column>
            <el-table-column align="center" width="200" prop="departmentName" label="单位名称"></el-table-column>
            <el-table-column align="center" :label="dataQuarter()">
              <el-table-column align="center" width="60" prop="score" label="分数">
                <template slot-scope="scope">
                  <input
                    type="text"
                    class="filling"
                    oninput="value=value.replace(/[^0-9.]/g,'')"
                    :disabled="isStatus"
                    v-model="scope.row.score"
                  />
                </template>
              </el-table-column>
              <el-table-column align="center" width="80" prop="rank" label="排名">
                <template slot-scope="scope">
                  <input
                    type="text"
                    class="filling"
                    oninput="value=value.replace(/[^\d]/g,'')"
                    :disabled="isStatus"
                    v-model="scope.row.rank"
                  />
                </template>
              </el-table-column>
              <el-table-column align="center" prop="rankDescription" label="描述">
                <template slot-scope="scope">
                  <input
                    type="text"
                    class="filling"
                    :disabled="isStatus"
                    v-model="scope.row.rankDescription"
                  />
                </template>
              </el-table-column>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button v-if="ButtonStatus" type="primary" @click="dataSubmit()">确 定</el-button>
        <el-button v-else disabled type="primary" @click="dataSubmit()">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出框打分 -->
    <el-dialog :title="titleName" :visible.sync="dialogGrade" width="30%" @closed="closeDialog">
      <el-form label-width="95px" :model="objCurr" :hide-required-asterisk="false">
        <el-form-item label="年份：" prop="year">
          <el-date-picker
            v-model="objCurr.year"
            type="year"
            size="small"
            placeholder="选择年"
            style="width:134px"
            value-format="yyyy"
            disabled
          ></el-date-picker>
          <span style="width:120px;" class="striping">
            <i>-</i>
            <b
              style="color:#303133;font-weight: 500;fong-size:12px;"
              v-text="objCurr.type ? '季度' : '月份'"
            ></b>
            <el-select
              v-model="objCurr.time"
              size="small"
              placeholder="请选择"
              style="width:100px;"
              @change="quartChange"
            >
              <el-option
                v-for="(item, index) in quarterList"
                :key="index"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item label="分数：" prop="score">
          <el-input size="medium" placeholder="请输入分数" v-model="objCurr.score" style="width:58%;"></el-input>
        </el-form-item>
        <el-form-item label="排名：" prop="rank">
          <el-input size="medium" placeholder="请输入排名" v-model="objCurr.rank" style="width:58%;"></el-input>
        </el-form-item>
        <el-form-item label="排名描述：" prop="rankDescription">
          <el-input
            type="textarea"
            size="medium"
            placeholder="请输入排名描述"
            v-model="objCurr.rankDescription"
            style="width:58%;"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="dialogGrade = false">取 消</el-button>
          <el-button type="primary" @click="submitFrom()">确 定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

    <!-- 附件列表弹框 -->
    <el-dialog
      width="60%"
      title="附件列表配置"
      :visible.sync="dialogFormVisible"
      :close-on-click-modal="false"
      @closed="closeDialog"
    >
      <el-form :inline="true" label-width="95px" :model="dutyFrom" :hide-required-asterisk="false">
        <el-form-item label="附件：" prop="file">
          <el-upload
            class="upload-demo"
            :action="uploadUrl"
            :on-success="successFile"
            :on-remove="handleDealFileRemove"
            :file-list="fileList"
            multiple
            ref="rebateUpload"
          >
            <el-button size="small" type="primary">点击上传</el-button>
          </el-upload>
        </el-form-item>
        <el-form-item>
          <el-button size="small" class="saveBtn" type="primary" @click="submitForms">添加</el-button>
        </el-form-item>
      </el-form>
      <el-table
        :data="fileTableData"
        border
        style="width: 100%"
        :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
      >
        <el-table-column prop="file" label="附件名称">
          <template slot-scope="scope">
            <a :href="returnFile(scope.row.file)">{{ scope.row.file }}</a>
          </template>
        </el-table-column>
        <el-table-column label="上传时间">
          <template slot-scope="scope">{{ scope.row.fileAddTime }}</template>
        </el-table-column>

        <el-table-column label="上传人" prop="userName"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button type="danger" @click="deleteFile(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>
<script>
import configJson from "../../api/config";

export default {
  data() {
    return {
      dialog: false,
      loading: false,
      titleName: "打分管理",
      targetId: this.$route.query.id,
      dialogGrade: false,
      tableData: [],
      temporaryData: [],
      objCurr: {
        id: "",
        type: true,
        year: new Date(),
        time: "",
        score: "",
        rank: "",
        departmentId: "",
        rankDescription: "",
      },
      quarterList: [
        { id: 1, name: "第一季度" },
        { id: 2, name: "第二季度" },
        { id: 3, name: "第三季度" },
        { id: 4, name: "第四季度" },
      ],
      imgUrl: "",
      showAddFormdialog: false,
      taskForm: {
        departmentId: "",
        type: 1,
        quarter: "",
        id: "",
        status: "",
      },
      activeName: "first",
      currName: "市级",
      currQuarter: 1,
      currIndex: 1,
      quarterList: [
        { id: 1, name: "第一季度" },
        { id: 2, name: "第二季度" },
        { id: 3, name: "第三季度" },
        { id: 4, name: "第四季度" },
      ],
      timer: null,
      sectionOptions: [],
      temporaryArray: {}, //用来临时存储
      departmentsId: "", //市级部门

      subtasksId: "",
      uploadUrl: configJson.API_URL + "fileController/uploadFile", //地址
      fileList: [],
      dialogFormVisible: false,
      fileQuarter: 1,
      secondAimsId: "",
      fileTableData: [],
      // 附件上传模块
      dutyFrom: {
        id: "",
        taskId: "",
        year: "",
        quarter: "",
        file: [],
        fileType: "",
      },
      fileName: "",
      bumenDepartments: [],
      ButtonStatus: false,
      isStatus: false,
    };
  },
  mounted() {
    this.getListByPage(1);
    this.getdepartmentTypeList();
  },
  methods: {
    // 打分删除列表
    deleteDatalisy(val) {
      console.log(val);
      this.$confirm("此操作将删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          if (val.id == null) {
            this.temporaryData.splice(val.index - 1, 1);
            this.temporaryData.forEach((item, index) => {
              item.index = index + 1;
            });
          } else {
            this.$axios
              .post(
                "/deptScore/removeDepartmentScore",
                {
                  id: val.id,
                },
                2
              )
              .then((res) => {
                if (res.code == 200) {
                  let _index = val.index - 1;
                  this.temporaryData.splice(_index, 1);
                  this.temporaryData.forEach((item, index) => {
                    item.index = index + 1;
                  });
                } else {
                  this.$message.error(`${res.msg}`);
                }
              })
              .catch((err) => {
                console.log(err);
              });
          }

          this.$message({
            type: "success",
            message: "删除成功!",
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    // 上传附件列表
    handFileList(row, index) {
      console.log(row);
      this.secondAimsId = row.departmentId;
      this.fileQuarter = index;
      this.getfileList();
      this.dialogFormVisible = true;
    },
    // 获取附件列表
    getfileList() {
      this.$axios
        .post(`/fileController/getListDaily`, {
          taskId: this.$route.query.id,
          secondAimsId: this.secondAimsId,
          fileQuarter: this.fileQuarter,
          type: 2,
        })
        .then((res) => {
          if (res.code == 200) {
            console.log(res);
            this.fileTableData = res.data;
            this.fileName = "";
            this.fileList = [];
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 添加附件
    submitForms() {
      if (this.dutyFrom.file == "") {
        this.$message.error("请选择附件");
      }
      let _obj = {
        aimsId: this.$route.query.id,
        files: this.dutyFrom.file,
        secondAimsId: this.secondAimsId,
        type: "2",
        fileQuarter: this.fileQuarter,
      };
      this.$axios
        .post(`fileController/addFile`, _obj)
        .then((res) => {
          if (res.code == 200) {
            console.log(res);
            this.$message({
              message: "数据更新成功",
              type: "success",
            });
            this.closeDialog();
            this.getfileList();
            this.dutyFrom.fileQuarter = "";
            this.dutyFrom.file = [];
            this.secondAimsId = "";
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    returnFile(val) {
      return `${configJson.API_URL}/fileController/${val}`;
    },
    closeDialog() {
      this.dutyFrom = {
        year: "",
        quarter: "",
        file: [],
        taskId: "",
        id: "",
        fileType: "",
      };
    },
    // 选择附件
    successFile(response, file, fileList) {
      console.log(response);
      if (response.code == 200) {
        this.fileList = fileList;
        console.log(this.fileList);
        let fileUrlStr = this.uploadUrl.split("/");
        let fileRemoveChl = fileUrlStr.slice(0, fileUrlStr.length - 1);
        this.fileUrlEnd = fileRemoveChl.join("/");
        this.fileName = this.fileUrlEnd + "/" + response.data;
        console.log(response.data);
        let _text = response.data;

        console.log(Array.isArray(this.dutyFrom.file));
        console.log(this.dutyFrom.file);
        this.dutyFrom.file.push(_text); //获取上传文件名
        console.log(this.dutyFrom.file);
      }
    },
    handleDealFileRemove(file, fileList) {
      this.fileList = fileList;
      this.fileName = "";
    },
    uploadExceed(files, fileList) {
      this.$set(fileList[0], "raw", files[0]);
      this.$set(fileList[0], "name", files[0].name);
      this.$refs["rebateUpload"].clearFiles(); //清除文件
      this.$refs["rebateUpload"].handleStart(files[0]); //选择文件后的赋值方法
      this.fileName = this.fileUrlEnd + "/" + files[0].name;
    },
    // 删除列表附件
    deleteFile(val) {
      this.$axios
        .post(
          `/fileController/deleteFileLib`,
          {
            id: val.id,
          },
          2
        )
        .then((res) => {
          if (res.code == 200) {
            console.log(res);
            this.$message({
              message: "数据更新成功",
              type: "success",
            });
            this.getfileList();
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    currChange() {
      this.getDeptQuarter();
    },
    dataQuarter() {
      let text = "";
      if (this.currQuarter == 1) {
        text = "一季度";
      } else if (this.currQuarter == 2) {
        text = "二季度";
      } else if (this.currQuarter == 3) {
        text = "三季度";
      } else {
        text = "第四季度";
      }
      return text;
    },
    // 弹出框添加数据
    addDatum() {
      if (this.departmentsId == "") {
        this.$message.error(`请先选择${this.currName}单位`);
        return;
      }

      if (this.temporaryArray) {
        let _list = JSON.parse(JSON.stringify(this.temporaryArray));
        for (const key in _list) {
          if (
            key == "departmentId" ||
            key == "departmentName" ||
            key == "departmentTypeId" ||
            key == "departmentTypeName" ||
            key == "taskName"
          ) {
            console.log(key);
          } else {
            _list[key] = null;
          }
        }
        for (let i = 0; i < this.temporaryData.length; i++) {
          if (this.temporaryData[i].departmentId == this.departmentsId) {
            this.$message.error("所选的部门单位已添加 ");
            return;
          }
        }
        console.log(this.sectionOptions, 9999999);
        this.sectionOptions[0].departments.forEach((item, index) => {
          if (item.id == this.departmentsId) {
            _list.departmentId = this.departmentsId;
            _list.departmentName = item.name;
          }
        });
        this.temporaryData.push(_list);
        this.temporaryData.forEach((item, index) => {
          item.index = index + 1;
        });
      } else {
        let _list = {
          caveat: null,
          departmentId: null,
          departmentName: null,
          departmentTypeId: this.currIndex,
          departmentTypeName: this.currName,
          id: null,
          rank: null,
          rankDescription: null,
          score: null,
          status: null,
          taskName: this.$route.query.name,
          time: null,
          year: null,
        };
        this.sectionOptions[0].departments.forEach((item, index) => {
          if (item.id == this.departmentsId) {
            _list.departmentId = this.departmentsId;
            _list.departmentName = item.name;
          }
        });

        for (let i = 0; i < this.temporaryData.length; i++) {
          if (this.temporaryData[i].departmentId == _list.departmentId) {
            this.$message.error("已存在的市级单位不能再次添加");
            return;
          }
        }
        this.temporaryData.push(_list);
        this.temporaryData.forEach((item, index) => {
          item.index = index + 1;
        });
      }
    },
    // 获取市级部门
    getdepartmentTypeList() {
      this.$axios
        .post("dept/getDepartmentTypeList")
        .then((res) => {
          if (res.code == 200) {
            this.sectionOptions = [];
            res.data.forEach((item, index) => {
              if (item.id == this.currIndex) {
                this.sectionOptions.push(item);
                this.bumenDepartments = this.sectionOptions[0].departments;
              }
            });
            console.log(this.sectionOptions);
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    cancelForm() {
      this.loading = false;
      this.dialog = false;
      clearTimeout(this.timer);
    },
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          done();
          this.currQuarter = "";
          this.dialog = false;
        })
        .catch((_) => {});
    },

    dataSubmit() {
      if (this.currQuarter == "") {
        this.$message.error("必须选择季度");
        return;
      }
      let _arr = [];
      let isFlag = true;
      this.temporaryData.forEach((item, index) => {
        if (
          item.rank == undefined ||
          item.score == undefined ||
          item.rank == "" ||
          item.score == ""
        ) {
          isFlag = false;
        }
        let obj = {
          id: item.id,
          time: this.currQuarter,
          departmentId: item.departmentId,
          score: item.score,
          rank: item.rank,
          rankDescription: item.rankDescription,
          taskId: this.$route.query.id,
          departmentTypeId: this.currIndex,
        };
        _arr.push(obj);
      });
      if (isFlag == false) {
        this.$message.error("排名和分数必须全部填写完成");
        return;
      }

      this.loading = true;
      this.$axios
        .post("/deptScore/addAll", _arr)
        .then((res) => {
          if (res.code == 200) {
            this.getListByPage(this.currIndex);
            this.$message({
              message: "数据已更新",
              type: "success",
            });
            this.dialog = false;
            this.loading = false;
          } else {
            this.$message.error(`${res.msg}`);
            this.dialog = false;
            this.loading = false;
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    Tabever(activeName, oldActiveName) {
      // console.log(activeName)
      if (activeName == "first") {
        this.currName = "市级";
        this.currIndex = 1;
        this.getListByPage(1);
      } else if (activeName == "second") {
        this.currIndex = 2;
        this.currName = "区县";
        this.getListByPage(2);
      } else if (activeName == "third") {
        this.currIndex = 3;
        this.currName = "开发区";
        this.getListByPage(3);
      } else if (activeName == "fourth") {
        this.currIndex = 4;
        this.currName = "西咸县区";
        this.getListByPage(4);
      }
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
    goBack() {
      this.$router.go(-1);
    },
    // 获取数据列表
    getListByPage(data) {
      this.$axios
        .post("/deptTask/getDeptScoreList", {
          taskId: this.targetId,
          departmentTypeId: data,
        })
        .then((res) => {
          if (res.code == 200) {
            console.log(res.data, "res.data;");
            this.tableData = res.data;
            this.temporaryArray = this.tableData[0];
            for (let i = 0; i < res.data.length; i++) {
              // 第一季度
              if (res.data[i].caveat1 == 1) {
                res.data[i].imgUrl1 = require("../../assets/img/redFlag.png");
              } else if (res.data[i].caveat1 == 0) {
                res.data[
                  i
                ].imgUrl1 = require("../../assets/img/yellowLight.png");
              } else {
                res.data[i].imgUrl1 = null;
              }
              // 第二季度
              if (res.data[i].caveat2 == 1) {
                res.data[i].imgUrl2 = require("../../assets/img/redFlag.png");
              } else if (res.data[i].caveat2 == 0) {
                res.data[
                  i
                ].imgUrl2 = require("../../assets/img/yellowLight.png");
              } else {
                res.data[i].imgUrl2 = null;
              }
              // 第三季度
              if (res.data[i].caveat3 == 1) {
                res.data[i].imgUrl3 = require("../../assets/img/redFlag.png");
              } else if (res.data[i].caveat3 == 0) {
                res.data[
                  i
                ].imgUrl3 = require("../../assets/img/yellowLight.png");
              } else {
                res.data[i].imgUrl3 = null;
              }
              // 第四季度
              if (res.data[i].caveat4 == 1) {
                res.data[i].imgUrl4 = require("../../assets/img/redFlag.png");
              } else if (res.data[i].caveat4 == 0) {
                res.data[
                  i
                ].imgUrl4 = require("../../assets/img/yellowLight.png");
              } else {
                res.data[i].imgUrl4 = null;
              }

              // if (res.data[i].caveat == 1) {
              //   res.data[i].imgUrl = require("../../assets/img/redFlag.png");
              // } else if (res.data[i].caveat == 2) {
              //   res.data[i].imgUrl = require("../../assets/img/yellowLight.png");
              // } else {
              //   res.data[i].imgUrl = require("../../assets/img/lv.png");
              // }
            }
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 打分
    dataGrade() {
      this.getdepartmentTypeList();
      this.currQuarter = 1;
      this.dialog = true;
      this.departmentsId = "";
      this.getDeptQuarter();
    },
    getDeptQuarter() {
      let obj = {
        time: this.currQuarter,
        departmentTypeId: this.currIndex,
        taskId: this.$route.query.id,
      };
      this.$axios
        .post("/deptTask/getDeptQuarter", obj, 2)
        .then((res) => {
          if (res.code == 200) {
            this.temporaryData = res.data;
            console.log(this.temporaryData.length);
            this.temporaryData.forEach((item, index) => {
              item.index = index + 1;
            });
            if(this.temporaryData.length !== 0){
              if (
                this.temporaryData[0].status === 0 ||
                this.temporaryData[0].status === -1
              ) {
                this.ButtonStatus = true;
              } else {
                this.ButtonStatus = false;
              }
              if (this.temporaryData.length != 0) {
                if (
                  this.temporaryData[0].status == 1 ||
                  this.temporaryData[0].status == 2
                ) {
                  this.isStatus = true;
                } else {
                  this.isStatus = false;
                }
                console.log();
              } else {
                console.log(this.temporaryData.length, 99999);
                this.getDeptQuarterTow();
              }
            }else{
              this.ButtonStatus = true;
              this.isStatus = false;
            }
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    getDeptQuarterTow() {
      let obj = {
        time: this.currQuarter,
        departmentTypeId: this.currIndex,
        taskId: this.$route.query.id,
      };
      this.$axios
        .post("/deptTask/getUpQuarterDept", obj, 2)
        .then((res) => {
          if (res.code == 200) {
            this.temporaryData = res.data;
            this.temporaryData.forEach((item, index) => {
              item.index = index + 1;
            });
            if (this.temporaryData.length != 0) {
              if (
                this.temporaryData[0].status == 1 ||
                this.temporaryData[0].status == 2
              ) {
                this.isStatus = true;
              } else {
                this.isStatus = false;
              }
            }
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 选择季度
    quartChange(val) {
      let obj = {
        departmentId: this.objCurr.departmentId,
        year: this.objCurr.year.getFullYear(),
        time: this.objCurr.time,
      };
      this.$axios
        .post("deptScore/load", obj, 2)
        .then((res) => {
          if (res.code == 200) {
            if (res.data) {
              this.objCurr.id = res.data.id;
              this.objCurr.score = res.data.score;
              this.objCurr.rank = res.data.rank;
              this.objCurr.rankDescription = res.data.rankDescription;
            } else {
              this.objCurr.id = "";
              this.objCurr.score = "";
              this.objCurr.rank = "";
              this.objCurr.rankDescription = "";
            }
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 编辑
    // handEdit(row) {
    //   this.dialogGrade = true;
    // },
    // 新增权限
    addPerFun(data) {
      this.$axios
        .post("deptScore/add", data, 2)
        .then((res) => {
          if (res.code == 200) {
            this.$message({
              message: "打分成功",
              type: "success",
            });
            this.getListByPage();
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 修改权限
    updataPer(data) {
      this.$axios
        .post("deptScore/update", data, 2)
        .then((res) => {
          if (res.code == 200) {
            this.$message({
              message: "修改成功",
              type: "success",
            });
            this.getListByPage();
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 保存
    submitFrom() {
      let obj = {
        departmentId: this.objCurr.departmentId,
        year: this.objCurr.year.getFullYear(),
        time: this.objCurr.time,
        type: 2,
        rank: this.objCurr.rank,
        rankDescription: this.objCurr.rankDescription,
        score: this.objCurr.score,
      };
      if (this.objCurr.id) {
        obj.id = this.objCurr.id;
        this.updataPer(obj);
      } else {
        this.addPerFun(obj);
      }
      this.dialogGrade = false;
    },
    // 关闭弹框
    closeDialog() {
      this.objCurr = {
        id: "",
        type: true,
        year: new Date(),
        time: "",
        score: "",
        rank: "",
        departmentId: "",
        rankDescription: "",
      };
    },
    audit(row) {
      this.showAddFormdialog = true;
      this.taskForm.departmentId = row.departmentId;
    },
    quarterChange(val) {
      let obj = {
        departmentId: this.taskForm.departmentId,
        type: 2,
        time: this.taskForm.quarter,
      };
      this.$axios
        .post("deptScore/load", obj, 2)
        .then((res) => {
          if (res.code == 200) {
            if (res.data) {
              this.taskForm.id = res.data.id;
              this.taskForm.status = res.data.status;
            } else {
              this.taskForm.id = "";
              this.taskForm.status = "";
            }
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    submitForm() {
      if (this.taskForm.id) {
        if (this.taskForm.status == 1) {
          this.$message({
            message: "待审核状态,不能重复申请",
            type: "success",
          });
        } else {
          this.$axios
            .post("deptScore/auditing", { id: this.taskForm.id, status: 1 }, 2)
            .then((res) => {
              if (res.code == 200) {
                if (res.data) {
                  this.$message({
                    message: "申请成功",
                    type: "success",
                  });
                  this.getListByPage();
                }
              }
            })
            .catch((err) => {
              console.log(err);
            });
        }
      } else {
        this.$message({
          message: "请先给该季度打分然后再申请审核!",
          type: "warning",
        });
      }
      setTimeout(() => {
        this.showAddFormdialog = false;
      }, 500);
    },
    cancelForm() {
      this.taskForm = {
        departmentId: "",
        type: 2,
        quarter: "",
        id: "",
      };
    },
  },
};
</script>
<style scoped>
.page {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.main {
  width: 100%;
  height: 100%;
}
.subnav {
  float: left;
  width: 100%;
  height: 60px;
  line-height: 60px;
  padding: 0 20%;
}
.searchLeft {
  float: left;
  width: 400px;
  /* height: 40px; */
}
.searchLeft > button {
  width: 100px;
  height: 40px;
  background: #409eff;
  color: #fff;
  border: 0px;
  font-size: 16px;
  text-align: center;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  position: relative;
  left: -8px;
  top: 1px;
}
.searchRight {
  float: left;
  width: auto;
}
.searchRight > span {
  display: inline-block;
  width: 80px;
  height: auto;
  font-size: 14px;
  text-align: center;
  margin-left: 20px;
}
.el-scrollbar__wrap {
  overflow-x: hidden;
}
.clearfix {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}
.describe {
  padding: 4px 4px;
}
.filling {
  font-size: 12px;
  border: 0px;
  left: 0;
  width: 100%;
  border-bottom: 1px solid #ccc;
}
.lightSty {
  display: inline-block;
  width: 40px;
  text-align: left;
}
.lightSty > b {
  display: inline-block;
  width: 20px;
  text-align: left;
}
</style>
<style>
/* .el-scrollbar__wrap {
  overflow: visible;
  overflow-y: scroll;
}
.el-drawer__header {
  margin-bottom: 0px;
} */
</style>
